<?php
    use_helper('Javascript');

    $c = new Criteria();
    $versiones = VersionPeer::doSelect($c);
    if ($instanciacion->getVersionId()) {
        $version_selected = $instanciacion->getVersionId();
    } else if (count($versiones)>0){
        $version_selected = $versiones[0]->getId();
    } else {
        $version_selected = "";
    }

    echo select_tag('instanciacion[version_id]',objects_for_select($versiones,'getId','getNombre',$version_selected,'include_custom=Seleccione'));//,array('onchange'=>'updateDimensiones("instanciacion/listarDimensiones",this.value)'));

    echo observe_field('instanciacion_version_id', array(
        'update'   => 'item_dimensiones',
        'url'      => 'instanciacion/listarDimensiones',
        'with'     => "'version_id=' + value"));

    echo javascript_tag(
        remote_function( array(
        'update'  => 'item_dimensiones',
        'url'     => 'instanciacion/listarDimensiones?version_id='. $version_selected,
        ))
    );
?>
     <div id="item_dimensiones">
     </div>